import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '校园名称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '校园地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '占地面积',
    align:"center",
    dataIndex: 'areaCount'
   },
   {
    title: '在校学生数',
    align:"center",
    dataIndex: 'studentCount'
   },
   {
    title: '教职工人数',
    align:"center",
    dataIndex: 'teacherCount'
   },
   {
    title: '开设班级总数',
    align:"center",
    dataIndex: 'classCount'
   },
   {
    title: '开设专业数',
    align:"center",
    dataIndex: 'majorCount'
   },
   {
    title: '就业率',
    align:"center",
    dataIndex: 'workRate'
   },
   {
    title: '创建时间',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '创建人',
    align:"center",
    dataIndex: 'createBy'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '校园名称',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入校园名称!'},
          ];
     },
  },
  {
    label: '校园简介',
    field: 'brief',
    component: 'JEditor',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入校园简介!'},
          ];
     },
  },
  {
    label: '校园地址',
    field: 'address',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入校园地址!'},
          ];
     },
  },
  {
    label: '占地面积',
    field: 'areaCount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入占地面积!'},
          ];
     },
  },
  {
    label: '在校学生数',
    field: 'studentCount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入在校学生数!'},
          ];
     },
  },
  {
    label: '教职工人数',
    field: 'teacherCount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入教职工人数!'},
          ];
     },
  },
  {
    label: '开设班级总数',
    field: 'classCount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入开设班级总数!'},
          ];
     },
  },
  {
    label: '开设专业数',
    field: 'majorCount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入开设专业数!'},
          ];
     },
  },
  {
    label: '就业率',
    field: 'workRate',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入就业率!'},
          ];
     },
  },
  
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '校园名称',order: 0,view: 'text', type: 'string',},
  address: {title: '校园地址',order: 2,view: 'text', type: 'string',},
  areaCount: {title: '占地面积',order: 3,view: 'text', type: 'string',},
  studentCount: {title: '在校学生数',order: 4,view: 'text', type: 'string',},
  teacherCount: {title: '教职工人数',order: 5,view: 'text', type: 'string',},
  classCount: {title: '开设班级总数',order: 6,view: 'text', type: 'string',},
  majorCount: {title: '开设专业数',order: 7,view: 'text', type: 'string',},
  workRate: {title: '就业率',order: 8,view: 'text', type: 'string',},
  createTime: {title: '创建时间',order: 9,view: 'text', type: 'string',},
  updateBy: {title: '更新人',order: 10,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
